import Vue from 'vue'
import Router from 'vue-router'
Vue.use(Router)

// 解决  菜单栏重复点击  报错
const originalPush = Router.prototype.push
Router.prototype.push = function push (location) {
  return originalPush.call(this, location).catch(err => err)
};

export default new Router({
  routes: [
    {
		  path: '/',
		  redirect: '/home/documentParse'
    },
    {
        path: '/home/documentParse',
        component: (resolve) => require(['@/view/home/documentParse.vue'], resolve),
        name: 'documentParse',
        meta: {
            title: '文档解析', icon: 'aboutUs', iconSelect: 'documentParse'
        }
    },
    {
        path: '/home/pictureManage',
        component: (resolve) => require(['@/view/home/pictureManage.vue'], resolve),
        name: 'pictureManage',
        meta: {
            title: '图片管理', icon: 'pictureManage', iconSelect: 'pictureManage'
        }
    },
    {
        path: '/home/GenerateWord',
        component: (resolve) => require(['@/view/home/GenerateWord.vue'], resolve),
        name: 'GenerateWord',
        meta: {
            title: '文档生成', icon: 'GenerateWord', iconSelect: 'GenerateWord'
        }
    }
  ]
})
